<?php

	$guid = $vars['entity']->getGUID();
	$action ="pel/editlang";
	$lang = $vars['entity']->description;
	$langtravel=$vars['entity']->travel;
	$langtraining=$vars['entity']->training;
	$langtraveldate=$vars['entity']->traveldate;
	$langtrainingdate=$vars['entity']->trainingdate;
	$langmedia=$vars['entity']->media;
	$langcertificat=$vars['entity']->certificat;
	$langorganisme=$vars['entity']->organisme;
	$langnote=$vars['entity']->note;
	$langdate=$vars['entity']->date;
	$ecoutervar=$vars['entity']->ecouter;
	$lirevar=$vars['entity']->lire;
	$conversationvar=$vars['entity']->conversation;
	$exprimervar=$vars['entity']->expression;
	$ecrirevar=$vars['entity']->ecrire;
	$access_id = $vars['entity']->access_id;
	$image=$vars['url'] . "/mod/pel/graphics/icon_customise_info.gif";
	$moins="<img src=\"".$vars['url']."/mod/pel/graphics/moins.gif"."\" alt=\"moins\"/>";
	$plus="<img src=\"".$vars['url'] . "/mod/pel/graphics/plus.gif"."\"alt=\"plus\"/>Ajouter un champ";
	//liste des fichiers upload�s
	//$file=$vars['entity']->file;
  
  $j=count($langcertificat);
  if(is_array($langcertificat)){
		foreach ($langcertificat as $k => $v){
			$certificat_textbox= elgg_view('input/text', array('internalname' => 'langcertificat_'.$k, 'value' => $langcertificat[$k]));
			$organisme_textbox= elgg_view('input/text', array('internalname' => 'langorganisme_'.$k, 'value' => $langorganisme[$k]));
			$note_textbox= elgg_view('input/text', array('internalname' => 'langnote_'.$k, 'value' => $langnote[$k]));
			$date_textbox= elgg_view('input/text', array('internalname' => 'langdate_'.$k, 'value' => $langdate[$k]));
			if ($k!=0)
				$tabcertificat.="<tr id=\"row_$k\"><td>$certificat_textbox</td><td>$organisme_textbox</td><td>$note_textbox</td><td>$date_textbox</td><td><input type=\"hidden\" name=\"champsSup[$k]\" value=\"$k\" /><a href=\"javascript:checkMoins($k)\" class=\"moins\" id=\"$k\">$moins</a></td></tr>";
			else
				$tabcertificat.="<tr><td>$certificat_textbox</td><td>$organisme_textbox</td><td>$note_textbox</td><td>$date_textbox</td><td><input type=\"hidden\" name=\"champsSup[$k]\" value=\"$k\" />&nbsp;</td></tr>";
	  }
  }
  else{
    $certificat_textbox = elgg_view('input/text', array('internalname' => 'langcertificat_0', 'value' => $langcertificat));
    $organisme_textbox = elgg_view('input/text', array('internalname' => 'langorganisme_0', 'value' => $langorganisme));
    $note_textbox = elgg_view('input/text', array('internalname' => 'langnote_0', 'value' => $langnote));
    $date_textbox = elgg_view('input/text', array('internalname' => 'langdate_0', 'value' => $langdate));
    $tabcertificat.="<tr><td>$certificat_textbox</td><td>$organisme_textbox</td><td>$note_textbox</td><td>$date_textbox</td><td><input type=\"hidden\" name=\"champsSup[0]\" value=\"0\" />&nbsp;</td></tr>";
  }

  $l=count($langtravel);
  if(is_array($langtravel)){
		foreach ($langtravel as $k => $v){
			$travel_textbox= elgg_view('input/text', array('internalname' => 'langtravel_'.$k, 'value' => $langtravel[$k]));
	    $traveldate_textbox= elgg_view('input/text', array('internalname' => 'langtraveldate_'.$k, 'value' => $langtraveldate[$k]));
	    if ($k!=0)
	    	$tabtravel.="<tr id=\"row_$k\"><td>$travel_textbox</td><td>$traveldate_textbox</td><td><input type=\"hidden\" name=\"champsSupTravel[$k]\" value=\"$k\" /><a href=\"javascript:checkMoins2($k)\" class=\"moinstravel\" id=\"$k\">$moins</a></td></tr>";
	    else
	    	$tabtravel.="<tr><td>$travel_textbox</td><td>$traveldate_textbox</td><td><input type=\"hidden\" name=\"champsSupTravel[$k]\" value=\"$k\" />&nbsp;</td></tr>";
    }
  }
  else{
    $travel_textbox = elgg_view('input/text', array('internalname' => 'langtravel_0', 'value' => $langtravel));
    $traveldate_textbox = elgg_view('input/text', array('internalname' => 'langtraveldate_0', 'value' => $langtraveldate));
    $tabtravel.="<tr><td>$travel_textbox</td><td>$traveldate_textbox</td><td><input type=\"hidden\" name=\"champsSupTravel[0]\" value=\"0\" />&nbsp;</td></tr>";
	}
	
	$m=count($langtraining);
	if(is_array($langtraining)){
		foreach ($langtraining as $k => $v){
			$training_textbox= elgg_view('input/text', array('internalname' => 'langtraining_'.$k, 'value' => $langtraining[$k]));
			$trainingdate_textbox= elgg_view('input/text', array('internalname' => 'langtrainingdate_'.$k, 'value' => $langtrainingdate[$k]));
			if ($k!=0)
				$tabtraining.="<tr id=\"row_$k\"><td>$training_textbox</td><td>$trainingdate_textbox</td><td><input type=\"hidden\" name=\"champsSupTraining[$k]\" value=\"$k\" /><a href=\"javascript:checkMoins3($k)\" class=\"moinstraining\" id=\"$k\">$moins</a></td></tr>";
			else
				$tabtraining.="<tr><td>$training_textbox</td><td>$trainingdate_textbox</td><td><input type=\"hidden\" name=\"champsSupTraining[$k]\" value=\"$k\" />&nbsp;</td></tr>";
	  }
	}
  else{
	  $training_textbox = elgg_view('input/text', array('internalname' => 'langtraining_0', 'value' => $langtraining));
	  $trainingdate_textbox = elgg_view('input/text', array('internalname' => 'langtrainingdate_0', 'value' => $langtrainingdate));
	  
	  $tabtraining.="<tr><td>$training_textbox</td><td>$trainingdate_textbox</td><td><input type=\"hidden\" name=\"champsSupTraining[0]\" value=\"0\" />&nbsp;</td></tr>";
  }
	//preparation des titres
	$access_label = elgg_echo('pel:acces');
  $title_label = elgg_echo('pel:otherlang');
  $autoEval = elgg_echo('pel:autoeval');
  $bio = elgg_echo('pel:bio');
  $dir = elgg_echo('pel:dir');
  $pays = elgg_echo('pel:pays');
  $travel = elgg_echo('pel:travel');
  $training = elgg_echo('pel:training');
  $media = elgg_echo('pel:media');
  $tab_intitule=elgg_echo('pel:intitule');
  //$file = elgg_echo('pel:file');
  $certificat = elgg_echo('pel:certificat');
  $nom = elgg_echo('pel:nom');
  $organisme = elgg_echo('pel:organisme');
  $note = elgg_echo('pel:note');
  $date= elgg_echo('pel:date');
  $ecouter=elgg_echo('pel:ecouter');
  $lire=elgg_echo('pel:lire');
  $conversation=elgg_echo('pel:conversation');
  $exprimer= elgg_echo('pel:exprimer');
  $ecrire= elgg_echo('pel:ecrire');
  $parler=elgg_echo('pel:parler');
  $comprendre=elgg_echo('pel:comprendre');
  $tabecouterA1=elgg_echo('pel:tabecouterA1');
  $tabecouterA2=elgg_echo('pel:tabecouterA2');
  $tabecouterB1=elgg_echo('pel:tabecouterB1');
  $tabecouterB2=elgg_echo('pel:tabecouterB2');
  $tabecouterC1=elgg_echo('pel:tabecouterC1');
  $tabecouterC2=elgg_echo('pel:tabecouterC2');
  $tablireA1=elgg_echo('pel:tablireA1');
  $tablireA2=elgg_echo('pel:tablireA2');
  $tablireB1=elgg_echo('pel:tablireB1');
  $tablireB2=elgg_echo('pel:tabelireB2');
  $tablireC1=elgg_echo('pel:tablireC1');
  $tablireC2=elgg_echo('pel:tablireC2');
  $tabconversationA1=elgg_echo('pel:tabconversationA1');
  $tabconversationA2=elgg_echo('pel:tabconversationA2');
  $tabconversationB1=elgg_echo('pel:tabconversationB1');
  $tabconversationB2=elgg_echo('pel:tabconversationB2');
  $tabconversationC1=elgg_echo('pel:tabconversationC1');
  $tabconversationC2=elgg_echo('pel:tabconversationC2');
  $tabexprimerA1=elgg_echo('pel:tabexprimerA1');
  $tabexprimerA2=elgg_echo('pel:tabexprimerA2');
  $tabexprimerB1=elgg_echo('pel:tabexprimerB1');
  $tabexprimerB2=elgg_echo('pel:tabexprimerB2');
  $tabexprimerC1=elgg_echo('pel:tabexprimerC1');
  $tabexprimerC2=elgg_echo('pel:tabexprimerC2');
  $tabecrireA1=elgg_echo('pel:tabecrireA1');
  $tabecrireA2=elgg_echo('pel:tabecrireA2');
  $tabecrireB1=elgg_echo('pel:tabecrireB1');
  $tabecrireB2=elgg_echo('pel:tabecrireB2');
  $tabecrireC1=elgg_echo('pel:tabecrireC1');
  $tabecrireC2=elgg_echo('pel:tabecrireC2');
	
	//préparation des input
  $title_textbox = elgg_view('input/text', array('internalname' => 'pellang', 'value' => $lang));
  $travel_textbox = elgg_view('input/longtext', array('internalname' => 'langtravel', 'value' => $langtravel));
  $training_textbox = elgg_view('input/longtext', array('internalname' => 'langtraining', 'value' => $langtraining));
  $media_textbox = elgg_view('input/longtext', array('internalname' => 'langmedia', 'value' => $langmedia));
  $certificat_textbox = elgg_view('input/text', array('internalname' => 'langcertificat', 'value' => $langcertificat));
  $organisme_textbox = elgg_view('input/text', array('internalname' => 'langorganisme', 'value' => $langorganisme));
  $note_textbox = elgg_view('input/text', array('internalname' => 'langnote', 'value' => $langnote));
  $date_textbox = elgg_view('input/text', array('internalname' => 'langdate', 'value' => $langdate));
  
  $control = ($ecoutervar=="A1") ? "A1" : false;
  $ecouterA1= elgg_view('input/radio',array('internalname' => 'ecouter', 'options' => array('' => 'A1'), 'value'=>$control));
  $control = ($ecoutervar=="A2") ? "A2" : false;
  $ecouterA2= elgg_view('input/radio',array('internalname' => 'ecouter', 'options' => array('' => 'A2'), 'value'=>$control));
  $control = ($ecoutervar=="B1") ? "B1" : false;
  $ecouterB1= elgg_view('input/radio',array('internalname' => 'ecouter', 'options' => array('' => 'B1'), 'value'=>$control));
  $control = ($ecoutervar=="B2") ? "B2" : false;
  $ecouterB2= elgg_view('input/radio',array('internalname' => 'ecouter', 'options' => array('' => 'B2'), 'value'=>$control));
  $control = ($ecoutervar=="C1") ? "C1" : false;
  $ecouterC1= elgg_view('input/radio',array('internalname' => 'ecouter', 'options' => array('' => 'C1'), 'value'=>$control));
  $control = ($ecoutervar=="C2") ? "C2" : false;
  $ecouterC2= elgg_view('input/radio',array('internalname' => 'ecouter', 'options' => array('' => 'C2'), 'value'=>$control));
  
  $control = ($lirevar=="A1") ? "A1" : false;
  $lireA1= elgg_view('input/radio',array('internalname' => 'lire', 'options' => array('' => 'A1'), 'value'=>$control));
  $control = ($lirevar=="A2") ? "A2" : false;
  $lireA2= elgg_view('input/radio',array('internalname' => 'lire', 'options' => array('' => 'A2'), 'value'=>$control));
  $control = ($lirevar=="B1") ? "B1" : false;
  $lireB1= elgg_view('input/radio',array('internalname' => 'lire', 'options' => array('' => 'B1'), 'value'=>$control));
  $control = ($lirevar=="B2") ? "B2" : false;
  $lireB2= elgg_view('input/radio',array('internalname' => 'lire', 'options' => array('' => 'B2'), 'value'=>$control));
  $control = ($lirevar=="C1") ? "C1" : false;
  $lireC1= elgg_view('input/radio',array('internalname' => 'lire', 'options' => array('' => 'C1'), 'value'=>$control));
  $control = ($lirevar=="C2") ? "C2" : false;
  $lireC2= elgg_view('input/radio',array('internalname' => 'lire', 'options' => array('' => 'C2'), 'value'=>$control));
  
  $control = ($conversationvar=="A1") ? "A1" : false;
  $conversationA1= elgg_view('input/radio',array('internalname' => 'conversation', 'options' => array('' => 'A1'), 'value'=>$control));
  $control = ($conversationvar=="A2") ? "A2" : false;
  $conversationA2= elgg_view('input/radio',array('internalname' => 'conversation', 'options' => array('' => 'A2'), 'value'=>$control));
  $control = ($conversationvar=="B1") ? "B1" : false;
  $conversationB1= elgg_view('input/radio',array('internalname' => 'conversation', 'options' => array('' => 'B1'), 'value'=>$control));
  $control = ($conversationvar=="B2") ? "B2" : false;
  $conversationB2= elgg_view('input/radio',array('internalname' => 'conversation', 'options' => array('' => 'B2'), 'value'=>$control));
  $control = ($conversationvar=="C1") ? "C1" : false;
  $conversationC1= elgg_view('input/radio',array('internalname' => 'conversation', 'options' => array('' => 'C1'), 'value'=>$control));
  $control = ($conversationvar=="C2") ? "C2" : false;
  $conversationC2= elgg_view('input/radio',array('internalname' => 'conversation', 'options' => array('' => 'C2'), 'value'=>$control));
  
  $control = ($exprimervar=="A1") ? "A1" : false;
  $exprimerA1= elgg_view('input/radio',array('internalname' => 'exprimer', 'options' => array('' => 'A1'), 'value'=>$control));
  $control = ($exprimervar=="A2") ? "A2" : false;
  $exprimerA2= elgg_view('input/radio',array('internalname' => 'exprimer', 'options' => array('' => 'A2'), 'value'=>$control));
  $control = ($exprimervar=="B1") ? "B1" : false;
  $exprimerB1= elgg_view('input/radio',array('internalname' => 'exprimer', 'options' => array('' => 'B1'), 'value'=>$control));
  $control = ($exprimervar=="B2") ? "B2" : false;
  $exprimerB2= elgg_view('input/radio',array('internalname' => 'exprimer', 'options' => array('' => 'B2'), 'value'=>$control));
  $control = ($exprimervar=="C1") ? "C1" : false;
  $exprimerC1= elgg_view('input/radio',array('internalname' => 'exprimer', 'options' => array('' => 'C1'), 'value'=>$control));
  $control = ($exprimervar=="C2") ? "C2" : false;
  $exprimerC2= elgg_view('input/radio',array('internalname' => 'exprimer', 'options' => array('' => 'C2'), 'value'=>$control));

  $control = ($ecrirevar=="A1") ? "A1" : false;
  $ecrireA1= elgg_view('input/radio',array('internalname' => 'ecrire', 'options' => array('' => 'A1'), 'value'=>$control));
  $control = ($ecrirevar=="A2") ? "A2" : false;
  $ecrireA2= elgg_view('input/radio',array('internalname' => 'ecrire', 'options' => array('' => 'A2'), 'value'=>$control));
  $control = ($ecrirevar=="B1") ? "B1" : false;
  $ecrireB1= elgg_view('input/radio',array('internalname' => 'ecrire', 'options' => array('' => 'B1'), 'value'=>$control));
  $control = ($ecrirevar=="B2") ? "B2" : false;
  $ecrireB2= elgg_view('input/radio',array('internalname' => 'ecrire', 'options' => array('' => 'B2'), 'value'=>$control));
  $control = ($ecrirevar=="C1") ? "C1" : false;
  $ecrireC1= elgg_view('input/radio',array('internalname' => 'ecrire', 'options' => array('' => 'C1'), 'value'=>$control));
  $control = ($ecrirevar=="C2") ? "C2" : false;
  $ecrireC2= elgg_view('input/radio',array('internalname' => 'ecrire', 'options' => array('' => 'C2'), 'value'=>$control));

 // $file_upload = elgg_view('input/file', array('internalname' => 'file_upload'));
  $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
  $access_input = elgg_view('input/access', array('internalname' => 'access_id', 'value' => $access_id));
  $entity_hidden = elgg_view('input/hidden', array('internalname' => 'post', 'value' => $guid));

	$url = $vars['url'];
  $form_body = <<<EOT
    <p>
			<label>$title_label</label><br />
      $title_textbox
    </p>
    <div id="example" class="flora  ui-tabs-nav">
      <ul id="pel_menu">
        <li><a href="#fragment-1"><span>$autoEval</span></a></li>
        <li><a href="#fragment-2"><span>$bio</span></a></li>
        <li><a href="#fragment-3"><span>$dir</span></a></li>
      </ul>
      <div id="fragment-1">
        <table id="pel">
        <tr>
          <tr><td><h3>$comprendre</h3></td></tr>
          <th scope="col">&nbsp;</th>
          <th scope="col">A1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">A2</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">B1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">B2</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">C1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">C2</th>
          <th scope="col">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row"><img src="$url/mod/pel/graphics/ecouter.gif"  alt="ecouter"/> $ecouter</th>
          <td>
            $ecouterA1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecouterA1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecouterA2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecouterA2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecouterB1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecouterB1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecouterB2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecouterB2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecouterC1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecouterC1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecouterC2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecouterC2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
        </tr>
        <tr>
          <th scope="row"><img src="$url/mod/pel/graphics/lire.gif"  alt="lire"/> $lire</th>
          <td>
            $lireA1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tablireA1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $lireA2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tablireA2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $lireB1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tablireB1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $lireB2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tablireB2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $lireC1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tablireC1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $lireC2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tablireC2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
        </tr>
        <tr><td>&nbsp;</td></tr>
        <tr><td><h3>$parler</h3></td></tr>
        <tr>
          <th scope="col">&nbsp;</th>
          <th scope="col">A1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">A2</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">B1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">B2</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">C1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">C2</th>
          <th scope="col">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row"><img src="$url/mod/pel/graphics/ppconv.gif"  alt="conversation"/> $conversation</th>
          <td>
            $conversationA1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabconversationA1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $conversationA2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabconversationA2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $conversationB1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabconversationB1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $conversationB2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabconversationB2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $conversationC1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabconversationC1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $conversationC2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabconversationC2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
        </tr>
        <tr>
          <th scope="row"><img src="$url/mod/pel/graphics/exp_oral_continu.gif"  alt="exprimer"/> $exprimer</th>
          <td>
            $exprimerA1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabexprimerA1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $exprimerA2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabexprimerA2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $exprimerB1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabexprimerB1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $exprimerB2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabexprimerB2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $exprimerC1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabexprimerC1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $exprimerC2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabexprimerC2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
        </tr>
          <tr><td>&nbsp;</td></tr>
          <tr><td><h3>$ecrire</h3></td></tr>
        <tr>
          <th scope="col">&nbsp;</th>
          <th scope="col">A1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">A2</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">B1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">B2</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">C1</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">C2</th>
          <th scope="col">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row"><img src="$url/mod/pel/graphics/ecrire.gif"  alt="ecrire"/> $ecrire</th>
        <td>
            $ecrireA1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecrireA1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecrireA2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecrireA2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecrireB1
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecrireB1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecrireB2
          </td>
          <td>
          	<a href="#" class="tooltip" title="$tabecrireB2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecrireC1
          </td><td>
          	<a href="#" class="tooltip" title="$tabecrireC1"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
          <td>
            $ecrireC2
          </td><td>
          	<a href="#" class="tooltip" title="$tabecrireC2"><img src="$image" width="14px" height="14px" alt=""/></a>
          </td>
        </tr>
      </table>
      </div>
      <div id="fragment-2">
				<h4>$travel</h4>
				<table id="tableToAppend2">
					<th class="grand">$pays</th>
					<th class="petit">$date</th>
					<th></th>
					$tabtravel
				</table>
				<a href="#" id="plustravel">$plus</a>
<script  type="text/javascript">
  $(document).ready(function(){
    var i = $l+1;
    $("a#plustravel").click(function(e){                                                                                                                                                                
      $("#tableToAppend2").append('<tr id="row_'+ i +'"><td><input name="langtravel_' + i + '" value="" class="input-text" type="text"></td><td><input name="langtraveldate_' + i + '" value="" class="input-text" type="text"></td><td><input type="hidden" name="champsSupTravel['+i+']" value="'+ i +'" /><a href="javascript:checkMoins2('+i+')" id="moinstravel" id="'+ i +'">$moins</a></td></tr>');
      i++;
    })
    checkMoins2 = function(i){
      $("#row_" + i).remove();
      i--;
    }
  });
</script>
        <h4>$training</h4>
        <table id="tableToAppend3">
	        <th class="grand">$tab_intitule</th>
	        <th class="petit">$date</th>
	        <th></th>
	        $tabtraining
        </table>
        <a href="#" id="plustraining">$plus</a>
<script  type="text/javascript">
  $(document).ready(function(){
    var i = $m+1;
    $("a#plustraining").click(function(e){                                                                                                                                                                
      $("#tableToAppend3").append('<tr id="row_'+ i +'"><td><input name="langtraining_' + i + '" value="" class="input-text" type="text"></td><td><input name="langtrainingdate_' + i + '" value="" class="input-text" type="text"></td><td><input type="hidden" name="champsSupTraining['+i+']" value="'+ i +'" /><a href="javascript:checkMoins3('+i+')" id="moinstraining" id="'+ i +'">$moins</a></td></tr>');
      i++;
    })
    checkMoins3 = function(i){
      $("#row_" + i).remove();
      i--;
    }
  });
</script>
				
        <h4>$media</h4>
        $media_textbox
    </div>
    <div id="fragment-3">
      <h4>$certificat</h4>
      <table id="tableToAppend">
        <th class="grand">$nom</th>
        <th class="grand">$organisme</th>
        <th class="petit">$note</th>
        <th class="petit">$date</th>
        <th>&nbsp;</th>
        $tabcertificat
      </table>
      <a href="#" id="plus">$plus</a>
<script  type="text/javascript">
  $(document).ready(function(){
    var i = $j+1;
    $("a#plus").click(function(e){                                                                                                                                                                
      $("#tableToAppend").append('<tr id="row_'+ i +'"><td><input name="langcertificat_' + i + '" value="" class="input-text" type="text"></td><td><input name="langorganisme_' + i + '" value="" class="input-text" type="text"></td><td><input name="langnote_' + i + '" value="" class="input-text" type="text"></td><td><input name="langdate_' + i + '" value="" class="input-text" type="text"> </td><td><input type="hidden" name="champsSup['+i+']" value="'+ i +'" /><a href="javascript:checkMoins('+i+')" id="moins" id="'+ i +'">$moins</a></td></tr>');
      i++;
    })
    checkMoins = function(i){
      $("#row_" + i).remove();
      i--;
    }
  });
</script>
			</div>
		</div>
	<p>
		$access_label
		$access_input
		$entity_hidden
		$submit_input
	</p>
EOT;

	echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body
                                         //,'enctype' => "multipart/form-data"
                                         ));
?>
